package ctrl_cali

import (
	"errors"
	"github.com/wsw188440873/ctrl-cali/base"
	"github.com/wsw188440873/ctrl-cali/sailhero"
)

type newCali func(stationId, thingId, caliId, modelId, requestId string) base.CaliBase

var initDataMap = map[string]newCali{
	"sailhero": sailhero.NewSaiHero, //先河环保校准
}

//NewCali 校准
func NewCali(cType, stationId, thingId, caliId, modelId, requestId string) (base.CaliBase, error) {
	if f, ok := initDataMap[cType]; ok {
		return f(stationId, thingId, caliId, modelId, requestId), nil
	}
	return nil, errors.New("not found")
}
